package com.hotel.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 角色表
 * </p>
 *
 * @author XiaoGe
 * @since 2022-05-28
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("tb_role")
public class Role extends Model<Role> {

    /**
     * 角色ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 角色名称
     */
    @TableField("role_name")
    private String roleName;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh",timezone ="GMT+8")
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField("modified_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh",timezone ="GMT+8")
    private Date modifiedTime;

    /**
     * 是否可用,0:不可用，1：可用
     */
    @TableField("status")
    private Integer status;

    /**
     * 角色描述
     */
    @TableField("description")
    private String description;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
